home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBASE102.ARJ / LSINST.BAT < prev    next >
DOS Batch File  |  1991-09-23  |  5KB  |  148 lines

  1. @echo off
  2. rem lseq installation batch file------------------------------------------------
  3. rem lsinst.bat    1.5 - 91/09/23
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - lseq library installation batch file for DOS
  8. rem
  9. rem SYNOPSIS
  10. rem      install model [x]
  11. rem
  12. rem DESCRIPTION
  13. rem     install.bat performs the installation of the lseq library for
  14. rem     DOS.  model specifies the memory model as one of the following.
  15. rem
  16. rem          S        small model
  17. rem          M        medium model
  18. rem          C        compact model
  19. rem          L        large model
  20. rem          H        huge model
  21. rem
  22. rem     The library file is named Mlseq.lib, where M would correspond
  23. rem     to the memory model of the library.
  24. rem
  25. rem     If specified, the second parameter causes the reference manual to
  26. rem     be extracted from the source code.  The reference manual is placed
  27. rem     in the file lseq.man.
  28. rem
  29. rem SEE ALSO
  30. rem      makefile
  31. rem
  32. rem NOTES
  33. rem      This batch file is written for use with Microsoft C.  To convert
  34. rem      it for use with another compiler, make the following
  35. rem      modifications:
  36. rem           1. Replace \usr\include with the include directory used by
  37. rem              the new compiler.
  38. rem           2. Replace \usr\lib with the library directory used by the
  39. rem              new compiler.
  40. rem           3. Replace cl with the command to invoke the compiler being
  41. rem              used, replacing the switches also, if necessary.  Below
  42. rem              are listed the Microsoft C switches used and their
  43. rem              meanings.
  44. rem                   -Oalt     optimization
  45. rem                         speed optimization
  46. rem                   -c        compile but don't link
  47. rem                   -Za       ANSI keywords only
  48. rem                   -A        memory model
  49. rem           4. The command to build the library archive from the object
  50. rem              modules may vary more drastically.  Microsoft C uses the
  51. rem              lib command with what is called a response file.  This
  52. rem              response file, lseq.rsp, contains a list of all the
  53. rem              object modules in the library.
  54. rem
  55. rem ----------------------------------------------------------------------------
  56.  
  57. rem verify arguments------------------------------------------------------------
  58. if "%1" == "S" goto arg1
  59. if "%1" == "M" goto arg1
  60. if "%1" == "C" goto arg1
  61. if "%1" == "L" goto arg1
  62. if "%1" == "H" goto arg1
  63. echo usage:  install model [x]
  64. echo Valid values for model are S (small), M (medium), C (compact),
  65. echo   L (large), and H (huge).  Model must be upper case.
  66. echo If x is specified, the reference manual will be extracted.
  67. goto end
  68. :arg1
  69.  
  70. if "%2" == "" goto arg2
  71. if "%2" == "x" goto arg2
  72. echo usage:  install model [x]
  73. echo Invalid second argument.  Valid value is lowercase x.
  74. goto end
  75. :arg2
  76.  
  77. if "%3" == "" goto arg3
  78. echo usage:  install model [x]
  79. echo Too many arguments specified.
  80. goto end
  81. :arg3
  82.  
  83. rem check if blkio installed----------------------------------------------------
  84. if exist \usr\include\blkio.h goto blkio
  85. echo The blkio library must be installed first.
  86. goto end
  87. :blkio
  88.  
  89. rem extract the reference manual------------------------------------------------
  90. if not "%2" == "x" goto skipman
  91. echo Extracting reference manual into lseq.man.
  92. if not exist lseq.man goto man
  93. echo lseq.man exists.  ^C to exit, any other key to continue.
  94. pause
  95. :man
  96. if not exist tmp goto tmp
  97. echo tmp exists.  ^C to exit, any other key to continue.
  98. pause
  99. :tmp
  100. echo on
  101. type lseq.h | manx -c >lseq.man
  102. copy lsclose.c/a+lscreate.c+lscursor.c+lsdelcur.c+lsfirst.c+lsgetcur.c tmp
  103. type tmp | manx -c >> lseq.man
  104. copy lsgetlck.c/a+lsgetr.c+lsgetrf.c+lsinsert.c+lslast.c+lslock.c tmp
  105. type tmp | manx -c >> lseq.man
  106. copy lsnext.c/a+lsopen.c+lsprev.c+lsputr.c+lsputrf.c+lsreccnt.c tmp
  107. type tmp | manx -c >> lseq.man
  108. copy lsrecsiz.c/a+lssearch.c+lssetbuf.c+lssetcur.c+lssetvbu.c+lssync.c tmp
  109. type tmp | manx -c >> lseq.man
  110. del tmp
  111. @echo off
  112. :skipman
  113.  
  114. rem compile all lseq source files-----------------------------------------------
  115. echo on
  116. cl -c -Oalt -Za -A%1 lsclose.c  lscreate.c lsdelcur.c lsfirst.c  lsgetcur.c lsgetlck.c
  117. cl -c -Oalt -Za -A%1 lsgetr.c   lsgetrf.c  lsinsert.c lslast.c   lslock.c   lsnext.c
  118. cl -c -Oalt -Za -A%1 lsopen.c   lsprev.c   lsputr.c   lsputrf.c  lssearch.c lssetbuf.c
  119. cl -c -Oalt -Za -A%1 lssetcur.c lssetvbu.c lssync.c
  120. cl -c -Oalt -Za -A%1 lsops.c    rcops.c
  121. @echo off
  122.  
  123. rem build the lseq library archive----------------------------------------------
  124. if exist %1lseq.lib del %1lseq.lib
  125. echo on
  126. lib %1lseq @lseq.rsp
  127. @echo off
  128.  
  129. rem install the lseq library----------------------------------------------------
  130. if not exist \usr\include\lseq.h goto h
  131. echo \usr\include\lseq.h exists.  ^C to exit, any other key to continue.
  132. pause
  133. :h
  134. echo on
  135. copy lseq.h \usr\include\lseq.h
  136. @echo off
  137.  
  138. if not exist \usr\lib\%1lseq.lib goto lib
  139. echo \usr\lib\%1lseq.lib exists.  ^C to exit, any other key to continue.
  140. pause
  141. :lib
  142. echo on
  143. copy %1lseq.lib \usr\lib\%1lseq.lib
  144. @echo off
  145.  
  146. rem end of lseq installation batch file-----------------------------------------
  147. :end
  148.